//
// Created by xili on 2024/8/30 21:42.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class Solution {
public:
    int maxJump(vector<int> &stones) {
        // 只有首尾节点的情况的特判
        int res = stones[1] - stones[0];
        // 遍历所有跨度为1的跳跃
        for (int i = 2; i < stones.size(); ++i)
            res = max(res, stones[i] - stones[i - 2]);
        return res;
    }
};